package com.iotimc.networklibrary.service;


import com.iotimc.networklibrary.entity.BaseEntity;

import java.util.Map;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Response;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Streaming;
import retrofit2.http.Url;

/**
 * Created by david on 2017/8/7.
 * @author david
 */

public interface FileService {
    @Multipart
    @POST
    Observable<ResponseBody> upload(@Url String url, @PartMap Map<String, RequestBody> params);

    @Multipart
    @POST
    Observable<BaseEntity<Integer>> upload(@Url String url, @Part RequestBody requestBody);


    @Streaming
    @POST
    Observable<Response<ResponseBody>> downloadFile(@Url String url);

}
